package com.example.Controller;

import com.example.Service.impl.PopServiceImpl;
import com.example.pojo.Pop;
import com.example.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/pop")
public class PopController {

    @Autowired
    private PopServiceImpl popService;


    //查询文章内容
    @GetMapping("/getContent/byPopId/{title}")
    public Result getContentByPopId(@PathVariable(value = "title",required = true) String title) {
        List<Pop> popList = popService.getContentByPopId(title);
        return new Result("200","查询成功",popList);
    }

}
